<div id="myBank<?php echo $uniqid;?>" class="myBankList">
  <el-table
          :data="params" :stripe="true" :border="true" size="medium"
          style="width: 96%">
    <el-table-column
            prop="type_name"
            label="提现方式"
            width="180">
    </el-table-column>
    <el-table-column
            prop="real_name"
            label="姓名"
            width="180">
    </el-table-column>
    <el-table-column
            prop="card_no"
            label="帐号">
        <template slot-scope="scope">
          {{scope.row.type === 'bank' ? scope.row.bank_name : ''}}{{scope.row.card_no}}
        </template>
    </el-table-column>
    <el-table-column
            prop="updated_at"
            label="操作时间"
            width="180">
    </el-table-column>
    <el-table-column label="操作" width="100">
      <template slot-scope="scope">
        <el-button v-if="scope.row.card_no"
                size="mini"
                @click="handleEdit(scope.$index,scope.row)">编辑</el-button>
        <el-button v-if="! scope.row.card_no"
                size="mini"
                type="danger"
                @click="handleAdd(scope.$index,scope.row)">增加</el-button>
      </template>
    </el-table-column>
  </el-table>
</div>
<div id="bankCreateDlg" class="easyui-dialog" style="width:840px; height:450px;" title="信息框" closed="true"></div>
<script>
  var myBankListVm = new Vue({
    el: '#myBank<?php echo $uniqid;?>',
    data: {
      params: JSON.parse('<?php echo addslashes($dataset);?>'),
    },
    methods: {
      handleEdit:function (index, row) {
        $("#bankCreateDlg").dialog({
          title: `修改${row.type_name}帐户`,
          closed: false,
          width: 840,
          height: 450,
          cache: false,
          href: `/merchant/bank/edit?index=${index}&id=${row.id}&type=${row.type}`,
          modal: true,
          buttons: [{
            text: '保存',
            id: 'bankCreateSubmit',
            iconCls: 'icon-ok',
          }, {
            text: '关闭',
            iconCls: 'icon-no',
            handler: function () {
              $("#bankCreateDlg").dialog('close');
            }
          }]
        });
      },
      handleAdd:function (index, row) {
        $("#bankCreateDlg").dialog({
          title: `新增${row.type_name}帐户`,
          closed: false,
          width: 840,
          height: 450,
          cache: false,
          href: `/merchant/bank/create?index=${index}&type=${row.type}`,
          modal: true,
          buttons: [{
            text: '保存',
            id: 'bankCreateSubmit',
            iconCls: 'icon-ok',
          }, {
            text: '关闭',
            iconCls: 'icon-no',
            handler: function () {
              $("#bankCreateDlg").dialog('close');
            }
          }]
        });
      }
    }
  });
</script>